<?php
/**
 * My Suggestion: Do you want to use JSON as the return type for these functions?
 *  because it would be more flexible to traverse them
 */
class User{
    /**
     * prints a list of users
     */
    public static function getUsers() {
        $users = '';
        $result = Chat::getUsers();
        if($result['total'] > 0){
            foreach($result as $user){
                $users .= $user->nickname . "<br />";
            }
        } else {
            $users = 'No online users';
        }
        echo $users;
    }
    
    /**
     * prints user's profile
     * @param String $user nickname
     */
    public static function getInfo($user){
        $user_info = "Nick name:" . $user->nickname . "<br />" .
            "Email: " . $user->email . "<br />" .
            "Law: " . $user->law . "<br />" .
            "Group: " . $user->group . "<br />" .
            "Last Activity: " . $user->last_activity . "<br />" .
            "Keeper: " . $user->keeper . "<br />" .
            "Gravatar: <img src=\"" . $user->gravatar . "\" /><br />";
        echo $user_info;
    }
}
?>